<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
		<script src="/../Thinkphp/Application/Home/View/User/jquery/jquery-3.1.0.js"></script>
		<script src="/../Thinkphp/Application/Home/View/User/jquery/jquery-3.1.0.min.js"></script>
		<script type="text/javascript">
			$(function($){
				$("#register").click(function(){
				var url="<?php print U('Home/User/doregister');?>";				
				var data={};
				data['name']=$("#register_name").val();
				data['pass']=$("#register_pass").val();
				data['phone']=$("#register_phone").val();
				var dataType ="json";
				$.post(
					url,
					data, 
					 function(data){						 
						if(data.status==1){
							location.href=data.url;
						};
					 },
					dataType 
				)
				
				
				
				return false;
				});
			});
		</script>
    </head>
    <body>
        <div>
            <h1>注册表单</h1>
            <form action="<?php print U('Home/User/doregister');?>" method="post" id="form_id">
                 <input type='hidden' name='id'/>
                姓名：<input type="text" name="name" id="register_name"/><br/>
                密码：<input type="password" name="pass" id="register_pass"/><br/>
                电话：<input type="text" name="phone" id="register_phone"/><br/>
                <input type="submit" value="确定" id="register"/>                
            </form>
        </div>
    </body>
</html>